__all__ = ["dmzj", "e_hentai", "sf", "hentairules","handler"]

def get_handler(url):
  global thread_num
  if url.find("hentairules")!=-1:
    from hentairules import hentairules_handler
    hd=hentairules_handler()
  elif url.find("comic.sfacg")!=-1:
    from sf import sf_handler
    hd=sf_handler()
  elif url.find("hotpic.sfacg")!=-1:
    from sf import sf_sub_handler
    hd=sf_sub_handler()
  elif url.find("e-hentai")!=-1:
    from e_hentai import e_hentai_handler
    hd=e_hentai_handler()
    thread_num=2
  elif url.find("manhua.178.com")!=-1:
    from dmzj import dmzj_handler
    hd=dmzj_handler()
  elif url.find("178.com")!=-1:
    from dmzj import dmzj_sub_handler
    hd=dmzj_sub_handler()
  else:
    raise Exception("gallery not recognized")
    exit(-1)
  return hd
